/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bllobject;

import bllInterface.Account;
import java.rmi.*;
import utils.DefaultPort;
import utils.RemoteFactory;

/**
 *
 * @author salm
 */
public class AccountImpl implements Account
{
    private long exp;
    private int level;
    private String typeID;
    private String userID;
    private String userName;
    
    public AccountImpl(String id, String name, long exp, int lvl, String typeID)
    {
        this.exp = exp;
        this.level = lvl;
        this.typeID = typeID;
        this.userID = id;
        this.userName = name;
    }

    @Override
    public long getExp() throws RemoteException {
        return exp;
    }

    @Override
    public int getLevel() throws RemoteException {
        return level;
    }
    
    public static Account createRemoteAccount(String id, String name, long exp, int lvl, String type) throws RemoteException
    {
        return RemoteFactory.<Account>createRemote(new AccountImpl(id, name, exp, lvl, type), DefaultPort.getInstance().getBLLPort());
    }

    @Override
    public String getTypeID() throws RemoteException {
        return this.typeID;
    }

    /**
     * @return the userID
     */
    @Override
    public String getUserID() throws RemoteException{
        return userID;
    }

    /**
     * @return the userName
     */
    @Override
    public String getUserName() throws RemoteException {
        return userName;
    }
}